//
// Created by Kame.Liang on 2021/9/5.
//

#include "SimpleFactory.h"
#include "CircleShape.h"
#include "RectangleShape.h"
#include <iostream>
IBaseShape* CSimpleFactory::makeShape(int type)
{
    IBaseShape* shape = nullptr;
    switch (type) {
        case st_circle:
            shape = new (std::nothrow) CCircleShape;
            break;
        case st_rectangle:
            shape = new (std::nothrow) CRectangleShape;
            break;
        default:
            break;
    }
    return shape;
}